class DocumentCorrection < ActiveRecord::Base
  belongs_to :document
  belongs_to :section
    
  def self.from_document(document)
    atts_for_new_object = document.attributes.merge(:section_title=>document.section.title,
      :document=>document)
    atts_for_new_object.delete("position")
    self.new(atts_for_new_object)
  end
  
  def self.from_section(section)
    atts_for_new_object = self.new(:section=>section, :section_title=>section.title)
  end
end
